package com.vito.dcs.roller.statistics.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.vito.base.model.DataGrid;
import com.vito.dcs.roller.statistics.dao.RollerStatisticsMapper;
import com.vito.dcs.roller.statistics.model.RollerStatisticsModel;
import com.vito.dcs.roller.statistics.service.RollerStatisticsService;

@Service
public class RollerStatisticsServiceImpl implements RollerStatisticsService{

	@Autowired
	private RollerStatisticsMapper rollerStatisticsMapper;
	
	@Override
	public void saveRollerStatistics(
			List<RollerStatisticsModel> rollerStatisticsModel) {
		if(rollerStatisticsModel.size() > 0){
			/*RollerStatisticsModel rollerStatisticsModel2 = rollerStatisticsModel.get(0);
			rollerStatisticsMapper.deleteRollerStatistics(rollerStatisticsModel2);
			rollerStatisticsMapper.saveRollerStatistics(rollerStatisticsModel);*/
		}
	}

	@Override
	public void deleteRollerStatistics(
			RollerStatisticsModel rollerStatisticsModel) {
		//rollerStatisticsMapper.deleteRollerStatistics(rollerStatisticsModel);
	}

	@Override
	public DataGrid<RollerStatisticsModel> queryRollerStatisticsByPage(
			RollerStatisticsModel rollerStatisticsModel) {
		DataGrid<RollerStatisticsModel> data = new DataGrid<RollerStatisticsModel>();
		List<RollerStatisticsModel> queryRollerStatisticsByPage = rollerStatisticsMapper.queryRollerStatisticsByPage(rollerStatisticsModel);
		data.setRows(queryRollerStatisticsByPage);
		data.setTotal(rollerStatisticsModel.getTotal());
		return data;
	}

	@Override
	public Map<String, Object> queryRollerNumber(Map<String, Object> map) {
		return rollerStatisticsMapper.queryRollerNumber(map);
	}

	@Override
	public RollerStatisticsModel queryRollerStatisticsByTime(
			RollerStatisticsModel rollerStatisticsModel) {
		return rollerStatisticsMapper.queryRollerStatisticsByTime(rollerStatisticsModel);
	}

}
